// SPDX-License-Identifier: GPL-2.0-only

#include <linux/crash_core.h>

void parse_crashkernel_auto(char **ck_cmdline)
{
	if (strncmp(*ck_cmdline, "auto", 4) == 0) {
#ifdef CONFIG_X86_64
		*ck_cmdline = "1G-64G:160M,64G-1T:280M,1T-:512M";
#elif defined(CONFIG_S390)
		*ck_cmdline = "4G-64G:160M,64G-1T:256M,1T-:512M";
#elif defined(CONFIG_ARM64)
		*ck_cmdline = "2G-:768M";
#elif defined(CONFIG_PPC64)
		*ck_cmdline = "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G";
#endif
		pr_info("Using crashkernel=auto, the size chosen is a best effort estimation.\n");
	}
}
